package com.kemang.store;

import java.util.Scanner;

public class Car_test {
    public static void main(String[] args) {
        Car[] car=new Car[3];
        Car car1=new Car();
        Car car2=new Car();
        Car car3=new Car();
        car[0]=car1;
        car[1]=car2;
        car[2]=car3;
        Scanner sc=new Scanner(System.in);
        for (int i = 0; i <car.length ; i++) {
            Car cars=car[i];
            System.out.println("请输入商标：");
            cars.setBrand(sc.next());
            System.out.println("请输入价格：");
            cars.setPrice(sc.nextDouble());
            System.out.println("请输入颜色：");
            cars.setColor(sc.next());
            System.out.println(cars.getBrand()+" "+cars.getPrice()+" "+cars.getColor());

        }
        sc.close();
    }
}
